package day_09;

public class FightGameTest {
    public static void main(String[] args) {
        //创建角色
        FightGame r1=new FightGame("乔峰",'男',100);
        FightGame r2=new FightGame("鸠摩智",'男',100);
        //显示角色
        r1.showrolyinfo();
        r2.showrolyinfo();
        //开始战斗
        while(true){
            //r1打r2
            r1.attack(r2);
            if(r2.getBlood()<=0){
                System.out.println(r1.getName()+"k.o了"+r2.getName());
                break;
            }
            //r2打r1
            r2.attack(r1);
            if(r1.getBlood()<=0){
                System.out.println(r2.getName()+"k.o了"+r1.getName());
                break;
            }
        }
    }
}
